//
// Created by Administrator on 2016/10/24.
//

#ifndef PROJECT_SKY_H
#define PROJECT_SKY_H

#include "EntityObject.h"

namespace ZainGL {
    class Sky : public EntityObject {
    public:
        Sky(const char *right, const char *left, const char *top, const char *bottom, const char *back,
            const char *front, std::unordered_map<std::string, ZainTL::FileDatas> *bufferMap = nullptr);

        GLfloat skyboxVertices[18 * 6] = {
                // Positions
                -1.0f, 1.0f, -1.0f,
                -1.0f, -1.0f, -1.0f,
                1.0f, -1.0f, -1.0f,
                1.0f, -1.0f, -1.0f,
                1.0f, 1.0f, -1.0f,
                -1.0f, 1.0f, -1.0f,

                -1.0f, -1.0f, 1.0f,
                -1.0f, -1.0f, -1.0f,
                -1.0f, 1.0f, -1.0f,
                -1.0f, 1.0f, -1.0f,
                -1.0f, 1.0f, 1.0f,
                -1.0f, -1.0f, 1.0f,

                1.0f, -1.0f, -1.0f,
                1.0f, -1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, -1.0f,
                1.0f, -1.0f, -1.0f,

                -1.0f, -1.0f, 1.0f,
                -1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, -1.0f, 1.0f,
                -1.0f, -1.0f, 1.0f,

                -1.0f, 1.0f, -1.0f,
                1.0f, 1.0f, -1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                -1.0f, 1.0f, 1.0f,
                -1.0f, 1.0f, -1.0f,

                -1.0f, -1.0f, -1.0f,
                -1.0f, -1.0f, 1.0f,
                1.0f, -1.0f, -1.0f,
                1.0f, -1.0f, -1.0f,
                -1.0f, -1.0f, 1.0f,
                1.0f, -1.0f, 1.0f
        };
        GLuint mCubeMapTextureLoc;

        virtual void draw(std::vector<glm::mat4> *const instanceTransforms= nullptr) override;

        void renderToShadowMap(std::vector<glm::mat4> *const instanceTransforms) override;
    };
}


#endif //PROJECT_SKY_H
